<?php /*a:2:{s:67:"D:\phpstudy_pro\WWW\tp-rbac\application\admin\view\login\login.html";i:1591060629;s:67:"D:\phpstudy_pro\WWW\tp-rbac\application\admin\view\public\head.html";i:1590389425;}*/ ?>
<!doctype html>
<html class="x-admin-sm">
    <head>
        <meta charset="UTF-8">
        <title>后台登录</title>
        <meta name="renderer" content="webkit|ie-comp|ie-stand">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
        <meta http-equiv="Cache-Control" content="no-siteapp" />
        <link rel="stylesheet" href="/xadmin/css/font.css">
        <link rel="stylesheet" href="/xadmin/css/login.css">
        <link rel="stylesheet" href="/xadmin/css/xadmin.css">
        <!-- <link rel="stylesheet" href="./css/theme5.css"> -->
        <script src="https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
        <script src="/xadmin/lib/layui/layui.js" charset="utf-8"></script>
        <script type="text/javascript" src="/xadmin/js/xadmin.js"></script>
        <!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
        <!--[if lt IE 9]>
          <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
          <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
        <![endif]-->
        <script>

        </script>
    </head>
</head>

<body class="login-bg">

    <div class="login layui-anim layui-anim-up">
        <div class="message">皇家宠物-管理登录</div>
        <div id="darkbannerwrap"></div>

        <form method="post" class="layui-form" action="<?php echo url('check'); ?>" method="post">
            <input type="hidden" name="__token__" value="<?php echo htmlentities($token); ?>" />
            <input name="name" placeholder="用户名" type="text" lay-verify="required" class="layui-input">
            <hr class="hr15">
            <input name="password" lay-verify="required" placeholder="密码" type="password" class="layui-input">
            <hr class="hr15">
            <div class="layui-form-item">
                <input type="text" class="layui-form-label" name="code" placeholder="验证码" style="width:50%;"  lay-verify="required">
            
                    <div  class="layui-input-block"><img id="verify_img" src="<?php echo captcha_src(); ?>" alt="captcha" style="width:70%;"  onclick="refreshVerify();"/></div>
               
            </div>
            <input value="登录" lay-submit lay-filter="login" style="width:100%;" type="button">

            <hr class="hr20">
            
        </form>
    </div>

    <script>
        $(function () {
            layui.use('form', function () {
                var form = layui.form;

                form.on('submit(login)', function (data) {
                    var formData = data.field;

                    $.ajax({
                        url: "<?php echo url('check'); ?>",
                        data: {
                            '__token__': formData.__token__,
                            'name': formData.name,
                            'password': formData.password,
                            'code': formData.code
                        },
                        type: "Post",
                        dataType: "json",
                        success: function (res) {
                            // console.log(res.data.token)
                            
                            layer.msg(res.msg);
                            if(res.code==1){
                                location.href="http://rbac.com/";
                            }
                            //   location.reload(); //删除成功后再刷新
                        }
                    })

                });


            });
        })
    </script>
    <script>
        function refreshVerify() {
            var ts = Date.parse(new Date())/1000;
            $('#verify_img').attr("src", "/captcha?id="+ts);
        }
    </script>
    <!-- 底部结束 -->

</body>

</html>